package com.tkmybatis.hfy.utils;

import java.io.ByteArrayOutputStream;
import java.io.PrintStream;

/**
 * 获取异常的所有信息
 */
public class ExceptionUtils {

	public static String getExceptionAllInformation(Exception ex) {
		ByteArrayOutputStream out = new ByteArrayOutputStream();
		PrintStream pout = new PrintStream(out);
		ex.printStackTrace(pout);
		String ret = new String(out.toByteArray());
		pout.close();
		try {
			out.close();
		} catch (Exception e) {
		}
		return ret;
	}

}
